Skip to content

test(azure): use Testcontainers for Azurite-backed tests - #9921

Open
Meir017 wants to merge 13 commits into
dotnet:mainfrom
Meir017:feature/azurite-testcontainers
Open

Meir017 wants to merge 13 commits into
dotnet:mainfrom
Meir017:feature/azurite-testcontainers

Conversation

@Meir017

@Meir017 Meir017 commented Feb 16, 2026 •

Copy link
Copy Markdown
Contributor

Azure Storage tests currently depend on separately provisioned Azurite services and connection-string plumbing, making local runs and CI setup inconsistent.

This change introduces a shared, lazily started Azurite Testcontainer when no Azure Storage connection string or AAD configuration is supplied. Explicit connection-string and AAD settings select existing storage services, while standalone silo processes reuse the generated connection string. Testcontainers supplies the service bindings, dynamic ports, and cleanup, replacing the separate Azurite setup in the GitHub Actions Azure Storage job.

Local tests skip when the initial Docker availability check fails. CI requires Linux Docker, and container startup errors fail tests in every environment. Azure grain storage and transaction benchmarks require an explicitly configured storage connection so results reflect the selected backend.

Related to #9708.

Microsoft Reviewers: Open in CodeFlow

Copilot AI lite review requested due to automatic review settings February 16, 2026 09:33
@Meir017 Meir017 changed the title [WIP] Feature/azurite testcontainers [WIP] Migrates Azure storage tests to use Testcontainers Feb 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This is a work-in-progress PR that migrates Azure Storage testing infrastructure from GitHub Actions services to Testcontainers, specifically focusing on Azurite. The change is part of a broader initiative (issue #9708) to simplify the testing infrastructure and make tests easier to run locally.

Changes:

  • Introduces AzuriteContainerManager to manage a singleton Azurite container using Testcontainers
  • Removes Azure AD authentication support from test configuration (TestDefaultConfiguration)
  • Updates all Azure Storage test configurations to use the new container manager instead of environment variables
  • Removes Azurite service definition from GitHub Actions workflow for Azure Storage tests

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/TestInfrastructure/TestExtensions/AzuriteContainerManager.cs New singleton manager for Azurite Testcontainer with lazy initialization
test/TestInfrastructure/TestExtensions/TestDefaultConfiguration.cs Removed Azure AD authentication properties and connection string configurations
test/TestInfrastructure/TestExtensions/TestUtils.cs Updated CheckForAzureStorage to use AzuriteContainerManager
test/TestInfrastructure/TestExtensions/TestExtensions.csproj Replaced Azure.Identity dependency with Testcontainers.Azurite
test/TesterInternal/GeoClusterTests/BasicLogTestGrainTests.cs Migrated to use AzuriteContainerManager connection string
test/Tester/Forwarding/ShutdownSiloTests.cs Migrated to use AzuriteContainerManager connection string
test/Extensions/TesterAzureUtils/Streaming/TestAzureTableStorageStreamFailureHandler.cs Migrated to use AzuriteContainerManager connection string
test/Extensions/TesterAzureUtils/Streaming/AQStreamingTests.cs Migrated to use AzuriteContainerManager connection string
test/Extensions/TesterAzureUtils/StorageEmulatorUtilities.cs Updated to check AzuriteContainerManager connection string
test/Extensions/TesterAzureUtils/AzureStorageOperationOptionsExtensions.cs Removed Azure AD auth logic and migrated all extension methods to use AzuriteContainerManager
test/Extensions/Tester.Cosmos/CosmosOptionsExtensions.cs Simplified to remove Azure AD authentication support
test/Extensions/ServiceBus.Tests/EventHubConfigurationExtensions.cs Simplified to remove Azure AD authentication support
test/Orleans.Journaling.Tests/JournalingAzureStorageTestConfiguration.cs Updated to use AzuriteContainerManager connection string
test/Benchmarks/Transactions/TransactionBenchmark.cs Migrated to use AzuriteContainerManager connection string
test/Benchmarks/GrainStorage/GrainStorageBenchmark.cs Migrated to use AzuriteContainerManager connection string (with bug in AdoNet configurator)
NuGet.Config Commented out Azure DevOps package feeds (should not be in this PR)
src/Directory.Build.props Commented out Microsoft.DotNet.GenAPI.Task (should not be in this PR)
Directory.Packages.props Added Testcontainers.Azurite package version
.github/workflows/ci.yml Removed Azurite service and connection string from Azure Storage test job

Comment thread .github/workflows/ci.yml Resolved
@Meir017

Meir017 commented Feb 16, 2026

Copy link
Copy Markdown
Contributor Author

getting errors Docker API responded with status code=NotFound, response={"message":"No such image: mcr.microsoft.com/azure-storage/azurite:3.35.0"}

seems random 😔

@ReubenBond

ReubenBond commented Feb 17, 2026 •

Copy link
Copy Markdown
Member

@Meir017 the Consul Testcontainers commit is causing failures in our internal Azure DevOps, I suppose we aren't allowed to access docker.io from there.

Docker.DotNet.DockerApiException : Docker API responded with status code=InternalServerError, response={"message":"Get "https://registry-1.docker.io/v2/": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"}
   at Docker.DotNet.DockerClient.HandleIfErrorResponseAsync(HttpStatusCode statusCode, HttpResponseMessage response) in /_/src/Docker.DotNet/DockerClient.cs:line 516
   at Docker.DotNet.DockerClient.MakeRequestForRawResponseAsync(HttpMethod method, String path, IQueryString queryString, IRequestContent body, IDictionary`2 headers, CancellationToken token) in /_/src/Docker.DotNet/DockerClient.cs:line 331
   at Docker.DotNet.Models.StreamUtil.MonitorResponseForMessagesAsync[T](Task`1 responseTask, DockerClient client, CancellationToken cancel, IProgress`1 progress) in /_/src/Docker.DotNet/Endpoints/StreamUtil.cs:line 80
   at DotNet.Testcontainers.Clients.DockerImageOperations.CreateAsync(IImage image, IDockerRegistryAuthenticationConfiguration dockerRegistryAuthConfig, CancellationToken ct) in /_/src/Testcontainers/Clients/DockerImageOperations.cs:line 73
   at DotNet.Testcontainers.Clients.TestcontainersClient.PullImageAsync(IImage image, CancellationToken ct) in /_/src/Testcontainers/Clients/TestcontainersClient.cs:line 430
   at DotNet.Testcontainers.Clients.TestcontainersClient.RunAsync(IContainerConfiguration configuration, CancellationToken ct) in /_/src/Testcontainers/Clients/TestcontainersClient.cs:line 337
   at DotNet.Testcontainers.Containers.DockerContainer.UnsafeCreateAsync(CancellationToken ct) in /_/src/Testcontainers/Containers/DockerContainer.cs:line 493
   at DotNet.Testcontainers.Containers.DockerContainer.StartAsync(CancellationToken ct) in /_/src/Testcontainers/Containers/DockerContainer.cs:line 337
   at Consul.Tests.ConsulTestUtils.EnsureConsulAsync() in /_/test/Extensions/Consul.Tests/ConsulTestUtils.cs:line 42
   at Consul.Tests.ConsulMembershipTableTest.GetConnectionString() in /_/test/Extensions/Consul.Tests/ConsulMembershipTableTest.cs:line 77
   at UnitTests.ConnectionStringFixture.get_ConnectionString() in /_/test/TesterInternal/ConnectionStringFixture.cs:line 25
   at UnitTests.MembershipTests.MembershipTableTestsBase..ctor(ConnectionStringFixture fixture, TestEnvironmentFixture environment, LoggerFilterOptions filters) in /_/test/TesterInternal/MembershipTests/MembershipTableTestsBase.cs:line 54
   at Consul.Tests.ConsulMembershipTableTest..ctor(ConnectionStringFixture fixture, TestEnvironmentFixture environment) in /_/test/Extensions/Consul.Tests/ConsulMembershipTableTest.cs:line 31
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Constructor(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)

I'm trying to see if we can fix that (#9933). We might need to disable Testcontainers tests in AzDO.

@Meir017

Meir017 commented Feb 17, 2026

Copy link
Copy Markdown
Contributor Author

@Meir017 the Consul Testcontainers commit is causing failures in our internal Azure DevOps, I suppose we aren't allowed to access docker.io from there.

Docker.DotNet.DockerApiException : Docker API responded with status code=InternalServerError, response={"message":"Get "https://registry-1.docker.io/v2/": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"}
   at Docker.DotNet.DockerClient.HandleIfErrorResponseAsync(HttpStatusCode statusCode, HttpResponseMessage response) in /_/src/Docker.DotNet/DockerClient.cs:line 516
   at Docker.DotNet.DockerClient.MakeRequestForRawResponseAsync(HttpMethod method, String path, IQueryString queryString, IRequestContent body, IDictionary`2 headers, CancellationToken token) in /_/src/Docker.DotNet/DockerClient.cs:line 331
   at Docker.DotNet.Models.StreamUtil.MonitorResponseForMessagesAsync[T](Task`1 responseTask, DockerClient client, CancellationToken cancel, IProgress`1 progress) in /_/src/Docker.DotNet/Endpoints/StreamUtil.cs:line 80
   at DotNet.Testcontainers.Clients.DockerImageOperations.CreateAsync(IImage image, IDockerRegistryAuthenticationConfiguration dockerRegistryAuthConfig, CancellationToken ct) in /_/src/Testcontainers/Clients/DockerImageOperations.cs:line 73
   at DotNet.Testcontainers.Clients.TestcontainersClient.PullImageAsync(IImage image, CancellationToken ct) in /_/src/Testcontainers/Clients/TestcontainersClient.cs:line 430
   at DotNet.Testcontainers.Clients.TestcontainersClient.RunAsync(IContainerConfiguration configuration, CancellationToken ct) in /_/src/Testcontainers/Clients/TestcontainersClient.cs:line 337
   at DotNet.Testcontainers.Containers.DockerContainer.UnsafeCreateAsync(CancellationToken ct) in /_/src/Testcontainers/Containers/DockerContainer.cs:line 493
   at DotNet.Testcontainers.Containers.DockerContainer.StartAsync(CancellationToken ct) in /_/src/Testcontainers/Containers/DockerContainer.cs:line 337
   at Consul.Tests.ConsulTestUtils.EnsureConsulAsync() in /_/test/Extensions/Consul.Tests/ConsulTestUtils.cs:line 42
   at Consul.Tests.ConsulMembershipTableTest.GetConnectionString() in /_/test/Extensions/Consul.Tests/ConsulMembershipTableTest.cs:line 77
   at UnitTests.ConnectionStringFixture.get_ConnectionString() in /_/test/TesterInternal/ConnectionStringFixture.cs:line 25
   at UnitTests.MembershipTests.MembershipTableTestsBase..ctor(ConnectionStringFixture fixture, TestEnvironmentFixture environment, LoggerFilterOptions filters) in /_/test/TesterInternal/MembershipTests/MembershipTableTestsBase.cs:line 54
   at Consul.Tests.ConsulMembershipTableTest..ctor(ConnectionStringFixture fixture, TestEnvironmentFixture environment) in /_/test/Extensions/Consul.Tests/ConsulMembershipTableTest.cs:line 31
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Constructor(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)

I'm trying to see if we can fix that (#9933). We might need to disable Testcontainers tests in AzDO.

I believe they have some strict rate limits on dockerhub. So creating a custom container registry and copying specific images could work (like the aspire repo does)

Copilot AI review requested due to automatic review settings August 6, 2026 13:34
@Meir017 Meir017 changed the title [WIP] Migrates Azure storage tests to use Testcontainers test(azure): use Testcontainers for Azurite-backed tests Aug 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated no new comments.

Suppressed comments (5)

test/TestInfrastructure/TestExtensions/TestUtils.cs:25

  • CheckForEventHub now only considers EventHubConnectionString. This breaks the existing AAD path (EventHubConfigurationExtensions uses EventHubFullyQualifiedNamespace when UseAadAuthentication=true), causing AAD-based Event Hubs tests to be skipped even when correctly configured.
        public static void CheckForEventHub()
        {
            if (string.IsNullOrWhiteSpace(EventHubConnectionString))
            {
                throw new SkipException("No connection string found. Skipping");

test/Extensions/Orleans.Azure.Tests/Streaming/AQStreamingTests.cs:53

  • AQStreamingTests now always configures the Azure Queue stream provider via a connection string. This removes the existing AAD configuration path (ServiceUri/Credential + ServiceKey), so running these tests with UseAadAuthentication=true will no longer work.
                    ConfigureStreaming("ProviderType", "AzureQueueStorage");
                    ConfigureStreaming("ConnectionString", TestDefaultConfiguration.AzureStorageConnectionString);

test/Extensions/Orleans.Azure.Tests/StorageEmulatorUtilities.cs:12

  • EnsureEmulatorIsNotUsed now reads AzureStorageConnectionString, which can start the Azurite container just to decide to skip. This adds unnecessary Docker startup overhead and side effects during precondition checks. Prefer checking the configured DataConnectionString (or its absence) without triggering container startup.
        public static void EnsureEmulatorIsNotUsed()
        {
            if (TestDefaultConfiguration.AzureStorageConnectionString is { Length: > 0 } connectionString
                && (connectionString.Contains("UseDevelopmentStorage", StringComparison.OrdinalIgnoreCase)
                || connectionString.Contains("devstoreaccount", StringComparison.OrdinalIgnoreCase)))

test/TestInfrastructure/TestExtensions/TestDefaultConfiguration.cs:53

  • AzureStorageConnectionString currently treats "UseDevelopmentStorage=true" as a real connection string (so tests will try to use a local emulator which is no longer auto-started) and it will also start Azurite even if UseAadAuthentication=true and a caller accidentally uses this property. Consider mapping the legacy value to Azurite and guarding against accidental use in AAD mode.
                var connectionString = DataConnectionString;
                return string.IsNullOrWhiteSpace(connectionString)
                    ? AzuriteContainerManager.ConnectionString
                    : connectionString;
            }

test/TestInfrastructure/TestExtensions/TestUtils.cs:17

  • CheckForAzureStorage no longer validates required AAD configuration and also won’t start Azurite when DataConnectionString is set to the legacy "UseDevelopmentStorage=true" value. In AAD mode this can now throw (eg new Uri(null)) instead of skipping, and in non-AAD mode it can leave tests pointing at a non-running local emulator.

This issue also appears on line 21 of the same file.

        public static void CheckForAzureStorage()
        {
            if (!UseAadAuthentication && string.IsNullOrWhiteSpace(DataConnectionString))
            {
                AzuriteContainerManager.EnsureStarted();

Copilot AI review requested due to automatic review settings August 6, 2026 14:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated no new comments.

Suppressed comments (5)

test/TestInfrastructure/TestExtensions/TestUtils.cs:26

  • CheckForEventHub now only checks EventHubConnectionString, which breaks AAD-backed runs: EventHubConfigurationExtensions uses EventHubFullyQualifiedNamespace + TokenCredential when UseAadAuthentication is true. With the current precondition, AAD runs will be skipped (or will later throw due to null-forgiving usage).

Update the precondition to accept either (AAD + fully-qualified namespace) or (connection string), and skip only when the relevant config is missing.

        {
            if (string.IsNullOrWhiteSpace(EventHubConnectionString))
            {
                throw new SkipException("No connection string found. Skipping");
            }

test/Extensions/Orleans.Azure.Tests/StorageEmulatorUtilities.cs:14

  • EnsureEmulatorIsNotUsed now reads AzureStorageConnectionString, which can start the Azurite container. In AAD-backed runs (where DataConnectionString is typically unset), this can incorrectly require Docker and skip/fail tests even though real Azure configuration is available.

This utility is meant to guard against explicitly configured storage-emulator connection strings, so it should inspect the raw DataConnectionString value instead of the fallback connection string.

            if (TestDefaultConfiguration.AzureStorageConnectionString is { Length: > 0 } connectionString
                && (connectionString.Contains("UseDevelopmentStorage", StringComparison.OrdinalIgnoreCase)
                || connectionString.Contains("devstoreaccount", StringComparison.OrdinalIgnoreCase)))
            {
                throw new SkipException("This test does not support the storage emulator.");

test/TestInfrastructure/TestExtensions/TestUtils.cs:18

  • CheckForAzureStorage no longer validates AAD-based configuration. In AAD mode, tests can now proceed with missing Azure Storage endpoint settings and later fail (or start Azurite unnecessarily). This also regresses the stated goal of keeping AAD configuration supported.

Consider explicitly checking for required AAD keys (without evaluating the Uri properties) and skipping with a clear message when missing; otherwise, start Azurite only when not using AAD and no connection string was supplied.

This issue also appears on line 22 of the same file.

        {
            if (!UseAadAuthentication && string.IsNullOrWhiteSpace(DataConnectionString))
            {
                AzuriteContainerManager.EnsureStarted();
            }

test/Extensions/Orleans.Azure.Tests/Streaming/AQStreamingTests.cs:53

  • This change removes the AAD-auth configuration path for Azure Queue streaming tests (it now always configures a connection string). That conflicts with the PR description which says AAD configuration remains supported, and it can also cause these tests to require Docker even when real Azure/AAD configuration is present.

Restore the prior AAD branch (ServiceUri + Credential + ServiceKey) and use AzureStorageConnectionString only for the connection-string path.

                    ConfigureStreaming("ProviderType", "AzureQueueStorage");
                    ConfigureStreaming("ConnectionString", TestDefaultConfiguration.AzureStorageConnectionString);

test/TestInfrastructure/TestExtensions/TestcontainerManager.cs:45

  • EnsureStartedAsync currently does all work synchronously (via _startSkipReason.Value) and then returns a completed Task. That makes the method name/return type misleading and can unexpectedly block async call paths.

If you want to keep the cached Lazy<string?> approach, consider offloading the potentially blocking initialization to the thread pool so callers can truly await it.

    public Task<bool> EnsureStartedAsync() => Task.FromResult(_startSkipReason.Value is null);

Copilot AI review requested due to automatic review settings August 6, 2026 14:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Suppressed comments (4)

test/TestInfrastructure/TestExtensions/TestUtils.cs:27

  • CheckForEventHub now only checks EventHubConnectionString, but AAD-based Event Hubs tests configure EventHubFullyQualifiedNamespace (see EventHubConfigurationExtensions.ConfigureTestDefaults). With UseAadAuthentication=true, this will incorrectly skip tests even when AAD config is present.
        public static void CheckForEventHub()
        {
            if (string.IsNullOrWhiteSpace(EventHubConnectionString))
            {
                throw new SkipException("No connection string found. Skipping");
            }
        }

test/Extensions/Orleans.Azure.Tests/StorageEmulatorUtilities.cs:15

  • EnsureEmulatorIsNotUsed now reads AzureStorageConnectionString, which can start an Azurite container as a side effect. That means tests which are about to be skipped for emulator usage may still spin up Docker, and AAD-based runs can be affected unnecessarily. This check should use the explicitly configured connection string (or AAD mode) rather than the Azurite fallback.
        public static void EnsureEmulatorIsNotUsed()
        {
            if (TestDefaultConfiguration.AzureStorageConnectionString is { Length: > 0 } connectionString
                && (connectionString.Contains("UseDevelopmentStorage", StringComparison.OrdinalIgnoreCase)
                || connectionString.Contains("devstoreaccount", StringComparison.OrdinalIgnoreCase)))
            {
                throw new SkipException("This test does not support the storage emulator.");
            }

test/TestInfrastructure/TestExtensions/TestcontainerManager.cs:4

  • DotNet.Testcontainers.Builders is not used in this file. With code-style enforcement enabled, the unused using can fail the build (CS8019) because warnings are treated as errors.
using Docker.DotNet;
using DotNet.Testcontainers.Builders;
using DotNet.Testcontainers.Containers;
using Xunit;

test/TestInfrastructure/TestExtensions/TestUtils.cs:19

  • CheckForAzureStorage no longer validates the AAD configuration. If UseAadAuthentication=true but TableEndpoint (and related endpoints) are not set, tests will later throw when TestDefaultConfiguration.TableEndpoint is evaluated instead of being skipped cleanly.
        public static void CheckForAzureStorage()
        {
            if (!UseAadAuthentication && string.IsNullOrWhiteSpace(DataConnectionString))
            {
                AzuriteContainerManager.EnsureStarted();
            }
        }

@Meir017

Meir017 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

@ReubenBond ready for review

Copilot AI review requested due to automatic review settings August 6, 2026 15:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated no new comments.

Suppressed comments (5)

test/TestInfrastructure/TestExtensions/TestUtils.cs:25

  • CheckForEventHub now only checks EventHubConnectionString, which breaks AAD-based Event Hubs test runs: when UseAadAuthentication is true, the tests use EventHubFullyQualifiedNamespace + TokenCredential, but this precondition method will always skip because the connection string is expected to be unset.
        public static void CheckForEventHub()
        {
            if (string.IsNullOrWhiteSpace(EventHubConnectionString))
            {
                throw new SkipException("No connection string found. Skipping");

test/TestInfrastructure/TestExtensions/TestUtils.cs:17

  • CheckForAzureStorage no longer validates the AAD-auth configuration. When UseAadAuthentication is true but required settings (e.g., TableEndpoint/DataBlobUri/DataQueueUri) are missing, tests will now fail later when those Uri properties are accessed (they throw on missing config) instead of skipping cleanly.

This issue also appears on line 21 of the same file.

        public static void CheckForAzureStorage()
        {
            if (!UseAadAuthentication && string.IsNullOrWhiteSpace(DataConnectionString))
            {
                AzuriteContainerManager.EnsureStarted();

test/TestInfrastructure/TestExtensions/TestcontainerManager.cs:4

  • using DotNet.Testcontainers.Builders; appears unused in this file and will typically produce CS8019 (unused using) which can fail the build when warnings are treated as errors. Remove the unused using directive.
using Docker.DotNet;
using DotNet.Testcontainers.Builders;
using DotNet.Testcontainers.Containers;

test/Extensions/Orleans.Azure.Tests/StorageEmulatorUtilities.cs:12

  • EnsureEmulatorIsNotUsed now reads AzureStorageConnectionString, which can lazily start Azurite and then cause these tests to be skipped even when UseAadAuthentication is true (i.e., when the intent is to run against real Azure endpoints). This guard should not trigger container startup and should only check the explicitly supplied connection string.
        public static void EnsureEmulatorIsNotUsed()
        {
            if (TestDefaultConfiguration.AzureStorageConnectionString is { Length: > 0 } connectionString
                && (connectionString.Contains("UseDevelopmentStorage", StringComparison.OrdinalIgnoreCase)
                || connectionString.Contains("devstoreaccount", StringComparison.OrdinalIgnoreCase)))

test/Extensions/Orleans.Azure.Tests/Streaming/AQStreamingTests.cs:53

  • The host-side streaming provider configuration now always uses AzureStorageConnectionString. In UseAadAuthentication mode this will force a connection-string/Azurite path (and potentially start Azurite) instead of using the existing AAD configuration, which contradicts the goal of keeping AAD-based internal runs working and can also diverge from the client-side configuration which still uses ConfigureTestDefaults() (AAD-aware).
                    ConfigureStreaming("ProviderType", "AzureQueueStorage");
                    ConfigureStreaming("ConnectionString", TestDefaultConfiguration.AzureStorageConnectionString);

@ReubenBond

Copy link
Copy Markdown
Member

thanks, @Meir017! Looks like GHA hit some issues. I'll retry the CI run soon

Copilot AI review requested due to automatic review settings August 6, 2026 17:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI review requested due to automatic review settings August 7, 2026 04:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated no new comments.

Suppressed comments (5)

test/TestInfrastructure/TestExtensions/TestUtils.cs:25

  • CheckForEventHub now only checks EventHubConnectionString, but EventHubConfigurationExtensions uses EventHubFullyQualifiedNamespace! when UseAadAuthentication is true. In AAD mode (with no connection string), this method will incorrectly skip the precondition check and tests can fail with a null-forgiving dereference. The precondition should match the chosen auth mode.
        public static void CheckForEventHub()
        {
            if (string.IsNullOrWhiteSpace(EventHubConnectionString))
            {
                throw new SkipException("No connection string found. Skipping");

test/Extensions/Orleans.Clustering.Consul.Tests/ConsulTestUtils.cs:40

  • IPC_LOCK capability is now added unconditionally. The previous implementation avoided setting this when running against a Windows Docker daemon/container mode. Adding Linux capabilities in those environments can cause container creation to fail, turning a previously-skipped test into a hard failure.
                .WithCreateParameterModifier(parameters =>
                {
                    if (parameters.HostConfig is not null)
                    {
                        parameters.HostConfig.CapAdd = ["IPC_LOCK"];

test/Benchmarks/GrainStorage/AzureBlobWriteStateStreamingBenchmark.cs:110

  • Benchmarks are not xUnit tests; using AzureStorageConnectionString can start an Azurite Testcontainer and throw SkipException when Docker is unavailable, which BenchmarkDotNet will report as a benchmark failure (and the message refers to "tests"). Consider keeping the benchmark’s dependency explicit by requiring DataConnectionString for the non-AAD path (as before) and throwing a clear InvalidOperationException if it’s missing.
        return new BlobServiceClient(TestDefaultConfiguration.AzureStorageConnectionString);

test/Benchmarks/GrainStorage/AzureBlobReadStateStreamingBenchmark.cs:121

  • Benchmarks are not xUnit tests; using AzureStorageConnectionString can start an Azurite Testcontainer and throw SkipException when Docker is unavailable, which BenchmarkDotNet will report as a benchmark failure (and the message refers to "tests"). Consider keeping the benchmark’s dependency explicit by requiring DataConnectionString for the non-AAD path (as before) and throwing a clear InvalidOperationException if it’s missing.
        return new BlobServiceClient(TestDefaultConfiguration.AzureStorageConnectionString);

test/TestInfrastructure/TestExtensions/TestUtils.cs:17

  • CheckForAzureStorage no longer validates AAD-based configuration. When UseAadAuthentication is true and TableEndpoint is missing/empty, tests can now fail later with Uri construction exceptions instead of being skipped. Consider restoring an explicit precondition check for the AAD path before proceeding.
        public static void CheckForAzureStorage()
        {
            if (UseAzurite)
            {
                AzuriteContainerManager.EnsureStarted();

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Docker startup failures after the preflight check can escape skip handling and fail Azure Storage tests.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 27/27 changed files
  • Comments generated: 1
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 13, 2026 15:08
@ReubenBond
ReubenBond force-pushed the feature/azurite-testcontainers branch from 1ea7e42 to 0fae3f0 Compare September 13, 2026 15:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Review details

  • Files reviewed: 27/27 changed files
  • Comments generated: 4
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 14, 2026 14:38
@ReubenBond
ReubenBond force-pushed the feature/azurite-testcontainers branch from 0fae3f0 to 1cae1c8 Compare September 14, 2026 14:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Three moderate issues remain in benchmark configuration and Azure Storage precondition handling.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (2)

test/Benchmarks/GrainStorage/GrainStorageBenchmark.cs:82

  • This benchmark setup now resolves AzureStorageConnectionString, which starts Azurite when no real connection string is configured. That makes GrainStorage.AzureBlob measure the emulator rather than the intended Azure backend and can surface an xUnit SkipException in the console benchmark if Docker is unavailable. Keep benchmark setup on an explicitly configured connection with a clear guard.
                options.BlobServiceClient = new(TestDefaultConfiguration.AzureStorageConnectionString);

test/Extensions/Orleans.Azure.Tests/AzureStorageOperationOptionsExtensions.cs:29

  • Event Hubs tests call this helper through EventHubConfigurationExtensions.ConfigureTestDefaults, but their fixture checks only Event Hubs configuration. With no OrleansDataConnectionString, this line now lazily starts Azurite; when Docker is unavailable, the resulting SkipException is raised during BaseTestClusterFixture.InitializeAsync rather than being captured by the fixture precondition path, so the tests do not follow the intended clean-skip behavior. Add an Azure Storage precondition for those callers or keep this fallback scoped to Azure Storage fixtures.
                : new(TestDefaultConfiguration.AzureStorageConnectionString, clientOptions);
  • Files reviewed: 26/26 changed files
  • Comments generated: 2
  • Review effort level: Lite

@ReubenBond
ReubenBond force-pushed the feature/azurite-testcontainers branch from 1cae1c8 to 81b0107 Compare September 16, 2026 04:21
Copilot AI review requested due to automatic review settings September 16, 2026 04:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Address the cancellation-token handling and retry-contract input declaration findings.

Review details

Suppressed comments (2)

.github/actions/run-tests/action.yml:46

  • This new input is also forwarded in the retry-contract workflow, which replaces dotnet-test/action.yml with .github/actions/run-tests/test-fixture/action.yml; that fixture does not declare max-parallel-test-modules. Each retry-contract run will therefore report an unexpected-input warning, so update the fixture's input contract alongside this forwarding change.
      max-parallel-test-modules: ${{ inputs.max-parallel-test-modules }}

test/TestInfrastructure/TestExtensions/TestContainerManager.cs:76

  • Passing CancellationToken.None to the actual container startup ignores the xUnit cancellation/hang token. If an image pull or Docker daemon stalls after the preflight succeeds, the test process cannot be canceled while waiting for StartAsync; pass the current test cancellation token (or thread a token through EnsureStarted) so startup observes test cancellation.
        var container = _container.Value;
        await _startAsync(container, CancellationToken.None).ConfigureAwait(false);
  • Files reviewed: 26/26 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 16, 2026 17:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Broad test infrastructure, Azure storage, and CI workflow changes require final human review.

Review details
  • Files reviewed: 28/28 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants